package com.java.demo.demo;

import java.util.ArrayList;
import java.util.List;

/**
 * @auther zhangwj
 * @date 2020/9/25 2:27 下午
 */
public class Demo4 {

    private static int MAXIMUM_CAPACITY = 16;

    private static final int tableSizeFor(int c) {//返回一个大于输入参数且最小的为2的n次幂的数。
        int n = c - 1;
        System.out.println("1---" + n);
        n |= n >>> 1;
        System.out.println("2---" + n);
        n |= n >>> 2;
        System.out.println("3---" + n);
        n |= n >>> 4;
        System.out.println("4---" + n);
        n |= n >>> 8;
        System.out.println("5---" + n);
        n |= n >>> 16;
        System.out.println("6---" + n);
        return (n < 0) ? 1 : (n >= MAXIMUM_CAPACITY) ? MAXIMUM_CAPACITY : n + 1;
    }

    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        for (int i = 0; i < 1000000000; i++) {
            list.add("1");
        }
    }
}
